function [ alteredMetadata ] = addLGPFunction( metadata, functionName, returnValueTypeCodes, argsTypeCodes )
%UNTITLED10 Summary of this function goes here
%   Detailed explanation goes here
    
    %each function is described by
    %function pointer (or name?)
    %types of outputs
    %types of inputs
    if length(argsTypeCodes) > metadata.maxFunctionArity 
        error('argTypeCodes cannot be longer than max function arity defined in popStruct.maxFunctionArity');
    end
    %metadata.functionSet = cell(1,3);
    %functionDefinition = {functionName returnValueTypeCodes argsTypeCodes};
    metadata.functionNames = [metadata.functionNames functionName];
    
    returnTypes = zeros(metadata.maxFunctionReturnValues,1);
    returnTypes(1:length(returnValueTypeCodes)) = returnValueTypeCodes;    
    metadata.functionReturnTypes = [metadata.functionReturnTypes returnTypes];
    
    argsTypes = zeros(metadata.maxFunctionArity,1);
    argsTypes(1:length(argsTypeCodes)) = argsTypeCodes;
    metadata.functionArgsTypes = [metadata.functionArgsTypes argsTypes];
        
    alteredMetadata = metadata;
end

